package com.huiyeji.hui.mapper;

import com.huiyeji.hui.entity.Invitation;
import com.huiyeji.hui.vo.InvitationVo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * @author zhaoduo
 */
@Mapper
public interface InvitationMapper {

    /**
     * 查询某用户收到的所有邀请
     * @param receiver 用户id
     * @return List<InvitationVo>
     */
    List<InvitationVo> getInvitationVoList(@Param("receiver") Long receiver);

    /**
     * 插入
     * @param invitation invitation
     */
    int insert(Invitation invitation);

    int changeInvitationStatus(@Param("id") Long id,@Param("receiver") Long receiver,@Param("status") Byte status);

    Invitation getInvitationById(@Param("id") Long id);

    void deleteInvitationsByGid(@Param("gid") Long gid);

    int updateCreateTime(Invitation invitation);

    int deleteById(@Param("uid") Long uid,@Param("id") Long id);
}
